package com.xmg.shop.api.order.domain;

import lombok.ToString;

import java.math.BigDecimal;

/**
 * Created by Administrator on 2017/11/17.
 */
@ToString
public class OrderProduct extends BaseDomain{

    private Long orderId ;//该订单的id
    private Long skuId; //该商品对应的skuid
    private String productName ;//商品名称
    private int productNumber;//商品的购买数量
    private BigDecimal productPrice;//商品价格
    private String skuAttr ;//sku属性和属性值

    public BigDecimal getAmount(){
        return productPrice.multiply(new BigDecimal(productNumber)) ;
    }

    public OrderProduct() {
    }

    public OrderProduct(Long orderId, Long skuId, String productName, int productNumber, BigDecimal productPrice, String skuAttr) {
        this.orderId = orderId;
        this.skuId = skuId;
        this.productName = productName;
        this.productNumber = productNumber;
        this.productPrice = productPrice;
        this.skuAttr = skuAttr;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public Long getSkuId() {
        return skuId;
    }

    public void setSkuId(Long skuId) {
        this.skuId = skuId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public int getProductNumber() {
        return productNumber;
    }

    public void setProductNumber(int productNumber) {
        this.productNumber = productNumber;
    }

    public BigDecimal getProductPrice() {
        return productPrice;
    }

    public void setProductPrice(BigDecimal productPrice) {
        this.productPrice = productPrice;
    }

    public String getSkuAttr() {
        return skuAttr;
    }

    public void setSkuAttr(String skuAttr) {
        this.skuAttr = skuAttr;
    }
}
